from flask import Flask
from flask_login import LoginManager

app = Flask(__name__)

# 配置密钥，用于保持会话安全
app.secret_key = 'your_secret_key'

# Flask-Login 配置
login_manager = LoginManager()
login_manager.init_app(app)
login_manager.login_view = 'auth.login'

# 导入用户加载函数
from models import load_user

# 注册蓝图
from auth.views import auth as auth_blueprint
from menu.index import menu as menu_blueprint
from dataop.dataopt import dataop as dataop_blueprint

app.register_blueprint(auth_blueprint, url_prefix='/auth')
app.register_blueprint(menu_blueprint, url_prefix='/menu')
app.register_blueprint(dataop_blueprint, url_prefix='/dataop')